package usbcali.edu.persistencia.dto;

import usbcali.edu.persistencia.Cargos;

import usbcali.edu.presentation.backEndBeans.CargosView;

import java.io.Serializable;

import java.util.Date;

import javax.faces.event.ActionEvent;


/**
*
*
* @author Zathura Code Generator http://code.google.com/p/zathura
*
*/
public class CargosDTO implements Serializable {
    private static final long serialVersionUID = 1L;
    private String codCargo;
    private String descripcion;
    private boolean rowSelected = false;
    private CargosView cargosView;
    private Cargos cargos;

    public Cargos getCargos() {
        return cargos;
    }

    public String listener_update(ActionEvent e) {
        try {
            cargosView.action_modifyWitDTO(((codCargo == null) ||
                codCargo.equals("")) ? null : new String(codCargo),
                ((descripcion == null) || descripcion.equals("")) ? null: new String(descripcion));
            rowSelected = !rowSelected;
        } catch (Exception ex) {
            return "";
        }

        return "";
    }

    public void listener_cancel(ActionEvent e) {
        codCargo = cargos.getCodCargo().toString();
        rowSelected = !rowSelected;
    }

    /**
    * <p>Bound to commandLink actionListener in the ui that renders/unrenders
        * the Customer details for editing.</p>
        */
    public void toggleSelected(ActionEvent e) {
        codCargo = cargos.getCodCargo().toString();
        rowSelected = !rowSelected;
    }

    public void setCargos(Cargos cargos) {
        this.cargos = cargos;
    }

    public CargosView getCargosView() {
        return cargosView;
    }

    public void setCargosView(CargosView cargosView) {
        this.cargosView = cargosView;
    }

    public String getCodCargo() {
        return codCargo;
    }

    public void setCodCargo(String codCargo) {
        this.codCargo = codCargo;
    }

    public boolean isRowSelected() {
        return rowSelected;
    }

    public void setRowSelected(boolean rowSelected) {
        this.rowSelected = rowSelected;
    }

	public String getDescripcion() {
		return descripcion;
	}

	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
    
    
    
}
